package hexagone;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class DrawHexagone extends JPanel {

//    public static JLabel NUM = new JLabel();
    public DrawHexagone() {
        DrawJCanvas jc = new DrawJCanvas();
        jc.setBackground(Color.WHITE);
        jc.setPreferredSize(new Dimension(1200, 1200));
//        NUM.setSize(30, 15);
//        NUM.setLocation(50, 60);
//        NUM.setBackground(Color.red);
//        NUM.setText("ici");
//        NUM.setVisible(true);
//        jc.add(NUM);
        showOnFrame(jc, "test");
    }

    public static void showOnFrame(JComponent component, String frameName) {
        JFrame frame = new JFrame(frameName);
        WindowAdapter wa = new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        };
        frame.addWindowListener(wa);
        frame.getContentPane().add(component);
        frame.pack();
        frame.setVisible(true);
    }
}




